home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sprite 1984 - 1993
/
Sprite 1984 - 1993.iso
/
src
/
lib
/
c
/
netlib
/
RCS
/
Net_NetToHostShort.c,v
< prev
next >
Wrap
Text File
|
1991-10-22
|
3KB
|
136 lines
head 1.3;
branch ;
access ;
symbols sprited:1.3.1;
locks ; strict;
comment @ * @;
1.3
date 89.01.27.16.38.40; author mendel; state Exp;
branches 1.3.1.1;
next 1.2;
1.2
date 88.11.21.09.28.24; author mendel; state Exp;
branches ;
next 1.1;
1.1
date 88.11.21.09.10.25; author mendel; state Exp;
branches ;
next ;
1.3.1.1
date 91.10.22.14.51.11; author kupfer; state Exp;
branches ;
next ;
desc
@Formed from net.c of src/lib/old/net.c.
@
1.3
log
@Removed newline from rcsid string.
@
text
@/*
* Net_NetToHostShort.c --
*
* Convert a short integer from network to host byte ordering.
*
* Copyright 1988 Regents of the University of California
* All rights reserved.
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies. The University of California
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*/
#ifndef lint
static char rcsid[] = "$Header: /sprite/src/lib/net/RCS/Net_NetToHostShort.c,v 1.2 88/11/21 09:28:24 mendel Exp $ SPRITE (Berkeley)";
#endif not lint
#include "machparam.h"
/*
*----------------------------------------------------------------------
*
* Net_NetToHostShort --
*
* Convert a short integer in network byte order to an short integer in
* host byte order.
*
* Results:
* The short integer in host byte order.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
unsigned short
Net_NetToHostShort(shortInt)
unsigned short shortInt; /* A short int in network byte order. */
{
#if BYTE_ORDER == LITTLE_ENDIAN
union swab {
unsigned short s;
unsigned char c[2];
} in, out;
in.s = shortInt;
out.c[0] = in.c[1];
out.c[1] = in.c[0];
return (out.s);
#else
return (shortInt);
#endif
}
@
1.3.1.1
log
@Initial branch for Sprite server.
@
text
@d18 1
a18 1
static char rcsid[] = "$Header: /sprite/src/lib/net/RCS/Net_NetToHostShort.c,v 1.3 89/01/27 16:38:40 mendel Exp $ SPRITE (Berkeley)";
@
1.2
log
@Fixed typo.
@
text
@d18 1
a18 2
static char rcsid[] = "$Header: /sprite/src/lib/net/RCS/Net_NetToHostShort.c,v 1.1 88/11/21 09:10:25 mendel Exp $ SPRITE
(Berkeley)";
@
1.1
log
@Initial revision
@
text
@d18 1
a18 1
static char rcsid[] = "$Header: net.c,v 2.0 87/08/11 09:34:20 brent Exp $ SPRITE
a60 1
#endif
@